Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overload function for sklearn to deal with sparse matrices #316

Merged

Conversation

ClementPinard
Copy link
Contributor

Got in the situation where I used some rescaling with StandardScaler and numpy arrays, and pylance kept saying me that the output was possibly a sparse matrix.

I added overload for functions and classes in sklearn/preprocessing/_data.pyi to indicate that the output of those functions is only sparse when the input is itself sparse (up to some details, depending on the functions).

@ClementPinard
Copy link
Contributor Author

@microsoft-github-policy-service agree

@debonte debonte merged commit 70ddd7e into microsoft:main Sep 19, 2024
3 checks passed
@debonte
Copy link
Contributor

debonte commented Sep 19, 2024

@ClementPinard, thanks for your contribution! There were a couple issues with the return_norm parameter on normalize. I fixed them and added tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants